home *** CD-ROM | disk | FTP | other *** search
/ Your Choice 3 / Your Choice Software Collection 3.iso / prgmming / swag08 / mail.swg < prev    next >
Text File  |  1994-09-22  |  30KB  |  1 lines

  1. SWAGOLX.EXE (c) 1993 GDSOFT  ALL RIGHTS RESERVED 00002                                                                           1      08-24-9413:37ALL                      WAYNE BOYD               Fidomsg.pas              SWAG9408    úÉi└    42     n¼   {πSomeone once posted a message with the header formats for Fido-style *.MSGs. Iπtook that original message and added to it to get the following program. Thisπprogram reads *.MSG files sequentially in your *.MSG directory. You can alterπthe program to do whatever you want.π}πuses dos,crt;ππType FidoHeader=record {structure of the Message Header}π        WhoTheMessageIsFrom,π        WhoTheMessageItTo   : Array[1..36] of Char; {ASCIIZ Strings}π        MessageSubject      : Array[1..72] of Char;π        MessageDate         : Array[1..20] of Char;π                {The Message Date is an ASCIIZ string following thisπ                format: DD MMM YY  HH:MM:SS<Null>-20 Characters Totalπ                Example: 01 Jun 94 20:00:00 is June 1st 1994 at 8:00PMπ                But SeaDog uses a slightly different version and youπ                might want to account for that, unfortunately I can'tπ                remember the exact format, also SLMAIL for SearchLightπ                BBS only puts one space between the year and the hourπ                even though it's supposed to be 2, I'm surprised thisπ                hasn't thrown mailers of other BBS programs}π        TimesTheMessageWasRead,π        DestinationNode,π        OriginalNode,π        CostofTheMessage,π        OriginalNet,π        DestinationNet      : Integer;π                {Note: TimesTheMessageWasRead & CostofTheMessage areπ                usually ignored when being exported from the BBS and canπ                be ignored when importing into a BBS}π        DateWritten,π        DateArrived         : LongInt;π                {I'm not sure how the dates are stored in here, butπ                they're usually ignored}π        MessageToWhichThisRepliesTo: Integer;{Irrevelant over a network}π        Arrtibutes          : Word;π                {Bit Field:π                    Bit 0 Private Messageπ                        1 Crashmailπ                        2 Message Was Readπ                        3 Message Was Sentπ                        4 File Attatched, Filename in subjectπ                        5 Forwarded Messageπ                        6 Orphan Message ???π                        7 Kill After Its Sent (I think)π                        8 Message Originated Here (local)π                        9 Holdπ                        10 Reservedπ                        11 File Request, Filenames in Subjectπ                        12 Return Receipt Requestedπ                        13 This message is a Return Receiptπ                        14 Audit Trail Requestedπ                        15 Update Request }π        UnReply             : Integer; {I have No Idea}πEnd;ππType FidoMsg=recordπ   msgchar : char;πend;ππ{The Message Text follows terminated by either a Null (#0) or to Cr's #13#13.πAlso all paragraphs are supposed to end with a Hard CR (#141) and you canπignore any #13 and reformat the text for your own program, also any linesπstarting with ^A (#1) should not be imported into the BBS, they are controlπlines... the contents of these lines varies so you'll have to find out that onπyour own }ππvarπ  header : fidoheader;π  headerf: file of fidoheader;π  MsgTxt : FidoMsg;π  MsgTxtf: file of FidoMsg;π  DirInfo: SearchRec;π  ch : char;π  cr,count : shortint;π  l : string;π  howlong : byte;πbeginπ  FindFirst('*.MSG', Archive, DirInfo);π  while DosError = 0 doπ  beginπ    window(1,1,80,25);π    clrscr;π    textcolor(lightgreen);π    WriteLn(DirInfo.Name);π    textcolor(green);π    assign(headerf,DirInfo.Name);π    reset(headerf);π    read(headerf,header);π    with header doπ    beginπ        Writeln('From:  ',WhoTheMessageIsFrom);π        Writeln('To  :  ',WhoTheMessageItTo);π        Writeln('Subj:  ',MessageSubject);π        Writeln('Date:  ',MessageDate);π    end;π    textcolor(white);π    Writeln('═══════════════════════════════════════════════════π════════════════════════');π    window(1,wherey,80,25);π    textcolor(cyan);π    close(headerf);π    assign(MsgTxtF,DirInfo.Name);π    reset(MsgTxtF);π    seek(MsgTxtF,sizeof(header));π    cr := 0;π    count := 0;π    l := '';π    repeatπ      read(MsgTxtF,MsgTxt);π      ch := MsgTxt.msgchar;π      if not (ch in [#10,#13]) thenπ      beginπ        l := l + ch;π        howlong := length(l);π      end;π      if length(l) > 78 thenπ      beginπ        count := length(l);π        while (count > 60) and (l[count] <> ' ') do dec(count);π        writeln(l,copy(l,1,count));π        delete(l,count,length(l));π      end;π      if ch = #13 thenπ      beginπ        writeln(l);π        l := '';π        howlong := 0;π      end;π      if pos('these things?',l) > 0 thenπ      beginπ        writeπ      end;π      (*π      if wherey > 15 thenπ      beginπ        textcolor(12);π        writeln;π        {π        write('Press enter: ');π        readln;π        }π        clrscr;π        textcolor(cyan);π      end;π      *)π    until eof(MsgTxtF) or (ioresult > 0);π    if l > '' thenπ    beginπ      writeln(l);π      l := '';π    end;π    textcolor(11);π    write('End of Msg: ');π    textcolor(7);π    readln;π    clrscr;π    FindNext(DirInfo);π  end;π  textcolor(7);πend.ππend.ππ                                                                                                       2      08-24-9413:46ALL                      GREG ESTABROOKS          QWK Conf Member listing  SWAG9408    / ¡    195    n¼   π{***********************************************************************}π{$M 16384,0,0}                  { Save memory for Calling PKUNZIP.      }πPROGRAM NMembers;               { May 16/94, Greg Estabrooks.           }πUSESπ     DOS;πCONSTπ     Ver      = 'V0.2ß';        { Current Version of program.           }π     ProgTitle= 'NMem '+Ver+'- Conference Member Tracking Program. ';π     Author   = 'CopyRight (C) 1994, Greg Estabrooks.';πTYPEπ    Direction = (Left,Right);ππ    MsgDHdr = RECORD            { Structre of QWK Message Header.       }π               Status    :CHAR;π               MNum      :ARRAY[1..7] OF CHAR;π               Date      :ARRAY[1..8] OF CHAR;π               Time      :ARRAY[1..5] OF CHAR;π               MTo       :ARRAY[1..25] OF CHAR;π               MFrom     :ARRAY[1..25] OF CHAR;π               MSubj     :ARRAY[1..25] OF CHAR;π               Pass      :ARRAY[1..12] OF CHAR;π               MRefer    :ARRAY[1..8] OF CHAR;π               NChunks   :ARRAY[1..6] OF CHAR;π               Active    :CHAR;π               MConf     :WORD;π               Fill      :ARRAY[1..3] OF CHAR;π             END;{MsgDHdr}ππ    NDXType = RECORDπ                Offset :LONGINT;π                Misc   :BYTE;π              END;ππ    MessInfType = RECORDπ                   Name  :STRING[25];   { Name of person message FROM.  }π                   Origin:STRING[80];   { Origin line from message.     }π                  END;ππVARπ  QWKName :STRING[128];         { QWK File to process.                  }π  OutFile :STRING[128];         { File to place new member names.       }π  WorkDir :STRING[128];         { Holds the name of our work directory. }π  OutHan  :TEXT;                { File handle for output file.          }π  MessDat :FILE;                { File handle for MESSAGES.DAT.         }ππ  NumMess :WORD;                { Number of messages in conference.     }π  NewMems :WORD;                { Number of new members found.          }π  NumFound:WORD;                { Holds number of different names found.}ππ  fOfs    :ARRAY[1..500] OF LONGINT;{ Holds offset info from NDX file.  }π  FInf    :ARRAY[1..500] OF MessInfType;ππFUNCTION PadStr( Dir :Direction; Str2Pad :STRING; Til :BYTE;π                                                 Ch :CHAR ) :STRING;π                         { Function to pad a string with 'Ch' until it  }π                         { is 'Til' long.                               }πVARπ   Temp :STRING;                { Temporary String info.                }πBEGINπ  Temp := Str2Pad;              { Initialize 'Temp' to users string.    }π  IF Length(Temp) < Til THEN    { If its smaller than 'Til' add padding.}π  WHILE (Length(Temp) < Til) DO { Loop until proper length reached.     }π   BEGINπ     CASE Dir OFπ      Right :Temp := Temp + Ch; { If Right then add to end of string.   }π      Left  :Temp := Ch + Temp; { If Left then add to begining.         }π     END;π   END;π  PadStr := Temp;               { Return proper result.                 }πEND;ππPROCEDURE InitVars;π                        { Procedure to initialize program variables.    }πVARπ   Temp :STRING[4];             { Temporary String value.               }πBEGINπ  FillChar(FInf,SizeOf(FInf),#0); { Clear FInf.                         }π  NumMess := 0;                 { Clear number of messages.             }π  NewMems := 0;                 { Clear number of new members found.    }π  QWKName := ParamStr(1);       { Get QWK Name from command line.       }π  NumFound := 1;                { Initialize 'NumFound.'                }π  Temp := ParamStr(2);          { Get Conf Number from command line.    }π  OutFile := 'CNF'+PadStr(Left,Temp,5,'0')+'.LST';π                                { Prepare output file name.             }ππ  GetDir(0,WorkDir);            { Save current directory.               }π  IF WorkDir[Length(WorkDir)] = '\' THENπ   WorkDir := WorkDir +'NMEM'π  ELSEπ   WorkDir := WorkDir +'\NMEM';πEND;{InitVars}ππPROCEDURE Syntax_Error;π                       { Display proper command line syntax to user.    }πBEGINπ  Writeln;                      { Skip a line.                          }π  Writeln(π     'Syntax: NMEM [drive]:[path]PacketName ConfNum');π                                { Show syntax for user.                 }π  Writeln;                      { Skip a line.                          }π                                { Show an example usage.                }π  Writeln('EXAMPLE : NMEM C:\QWK\MYBBS.QWK 123');π  Writeln(' Scans MYBBS.QWK and generates CNF00123.LST');π  Halt(1);                      { Halt program with and ERRORLEVEL of 1.}πEND;{Syntax_Error}ππFUNCTION fExist( FName :STRING ) :BOOLEAN;π                        { Routine to determine whether or not 'FName'   }π                        { really exists.                                }πBEGINπ  fExist := (fSearch(FName,'') <> '');πEND;{fExist}ππFUNCTION DirExist( DName :STRING ) :BOOLEAN;π                         { Routine to determine whether or not the      }π                         { Directory 'DName' exists.                    }πVARπ   DirInf :SearchRec;           { Hold info if dir found.               }πBEGINπ  FindFirst(DName,Directory,DirInf);π  DirExist := (DosError = 0);πEND;{DirExist}ππPROCEDURE DelWorkDir;π                         { Routine to delete files in the work directory}π                         { and them remove the directory.               }πVARπ   FileInf :SEARCHREC;          { Holds file names for erasure.         }π   fVar    :FILE;               { Handle of file to delete.             }πBEGINπ  FindFirst(WorkDir+'\*.*',Archive,FileInf); { Get File Name.           }π  WHILE (DosError = 0) DO       { Loop until all file names read.       }π  BEGINπ    Assign(fVar,WorkDir+'\'+FileInf.Name);π                                { Assign file name to handle.           }π    Erase(fVar);                { Erase File.                           }π    FindNext(FileInf);          { Get next file name.                   }π  END;πEND;{DelWorkDir}ππPROCEDURE OpenPacket( QName :STRING );π                         { Routine open mail packets.                   }πVARπ   PKPath :STRING;              { Holds location of PKUNZIP.EXE         }πBEGINπ  IF NOT DirExist(WorkDir) THEN { If dir doesn't exist then make it.    }π   BEGINπ    {$I-}                       { Turn I/O checking off.                }π    MKDir(WorkDir);             { Create our work directory.            }π    {$I+}                       { Turn I/O checking off.                }ππ    IF IOResult <>0 THEN        { If I/O error then                     }π     BEGIN                      { Display error message.                }π      Writeln('Error creating work directory',^G);π      Halt(1);                  { Now halt program.                     }π     END;ππ   ENDπ  ELSEπ   DelWorkDir;                  { If it does exist then clear it.       }ππ  IF NOT fExist('PKUNZIP.EXE') THEN { If it's not in the current dir    }π   BEGIN                        { then search the %PATH%.               }π    PKPath := fSearch('PKUNZIP.EXE',GetEnv('PATH'));π    IF PKPath = '' THEN         { If it's nowhere to be found then      }π     BEGIN                      { Display error message.                }π      Writeln('Cannot find PKUNZIP.EXE!',^G);π      Writeln('It must be located either in the ',π                 'current directory or along your %PATH%');π      Halt(1);                  { Now halt program.                     }π     END;π   END;ππ  SwapVectors;                  { Swap to proper Interrupt vectors.     }π  Exec(GetEnv('COMSPEC'),'/C '+PKPath+' '+QWKName+' '+WorkDir+' >NUL');π  SwapVectors;                  { Swap em back.                         }ππ  IF DosError <> 0 THEN         { If there was an 'Exec' error then     }π   BEGIN                        { Display error message.                }π    Writeln('Error #',DosError,' occured executing ',PKPath,^G);π    Halt(1);                    { Now Halt program.                     }π   END;ππ  IF DosExitCode <> 0 THEN      { Check for a program error.            }π   Writeln(PKPath,' returned an ERRORLEVEL of ',DosExitCode,^G);πEND;{OpenPacket}ππFUNCTION NotNumber( NumStr :STRING ) :BOOLEAN;π                         { Routine to determine whether or not 'NumStr' }π                         { is a valid number.                           }π                         { Returns TRUE if not a number FALSE if a num. }πVARπ   Result :BOOLEAN;             { Holds Function result.                }π   StrPos :BYTE;                { Position withing string.              }πBEGINπ  Result := FALSE;              { Defaults to false.                    }π  FOR StrPos := 1 TO Length(NumStr) DO { Loop through entire string.    }π   IF NOT (NumStr[StrPos] INπ            ['0','1','2','3','4','5','6','7','8','9']) THENπ     Result := TRUE;ππ  NotNumber := Result;          { Return proper result.                 }πEND;{NotNumber}ππFUNCTION ReadNDX :BOOLEAN;π                         { Routine to read proper NDX file for conference.}πVARπ   Result :BOOLEAN;             { Holds Function result.                }π   NDX    :FILE;                { File handle for NDX file.             }π   Info   :NDXType;             { Hold info read from NDX file.         }π   NumRead:WORD;                { Holds number of bytes read from NDX.  }πBEGINπ  Result := TRUE;               { Default to success.                   }π  Assign(NDX,WorkDir+'\'+PadStr(Left,ParamStr(2),3,'0')+'.NDX');π  {$I-}                         { Turn off I/O checking.                }π  Reset(NDX,1);                 { Open NDX for reading.                 }π  {$I+}                         { Turn on I/O checking.                 }π  WHILE NOT EOF(NDX) DO         { Loop until end of file.               }π   BEGINπ     BlockRead(NDX,Info,SizeOf(Info),NumRead); { Read offset of message.}π     IF (NumRead = Sizeof(Info)) AND (NumMess <501) THENπ                                { If proper amount read then            }π      BEGIN                     { Convert it to a proper LONGINT.       }π        INC(NumMess);           { Increase message total.               }π                                { Now convert offset.                   }π        fOfs[NumMess] := ((Info.Offset AND NOT $FF000000) OR $00800000)π                          SHR (24 - ((Info.Offset SHR 24) AND $7F));π        fOfs[NumMess] := (fOfs[NumMess]-1) SHL 7;π      ENDπ     ELSEπ      Result := FALSE;          { Otherwise return FALSE result.        }π   END;π  Close(NDX);                   { Close NDX File.                       }π  ReadNDX := Result;            { Return proper result.                 }πEND;{ReadNDX}ππPROCEDURE RemoveSpaces(VAR Str2Rem :STRING);π                         { Routine to remove any spaces from 'Str2Rem'. }πVARπ   StrPos :WORD;                { Position within string.               }π   Temp   :STRING;              { Temporary string work space.          }πBEGINπ  Temp := '';                   { Clear string.                         }π  FOR StrPos := 1 TO Length(Str2Rem) DO { Loop through all characters.  }π   IF Str2Rem[StrPos] <> #32 THEN   { If its not a space then           }π    Temp := Temp + Str2Rem[StrPos]; { add it to our string.             }ππ  Str2Rem := Temp;              { Return newly changed string.          }πEND;{RemoveSpaces}ππFUNCTION Compare( Str1,Str2 :STRING ) :BOOLEAN;π                         { Routine to compare to strings after removing }π                         { any spaces from it.Case INSENSITIVE.         }πVARπ   Result :BOOLEAN;             { Result from comparing.                }π   StrPos :BYTE;                { Position within 2 strings.            }πBEGINπ  Result := TRUE;               { Default result to TRUE.               }π  RemoveSpaces(Str1);           { Trim spaces from the strings.         }π  RemoveSpaces(Str2);π  IF Length(Str1) <> Length(Str2) THEN { If different lengths then they }π   Result := FALSE                     { must be different.             }π  ELSEπ   BEGINπ    StrPos := 0;                { Initialize 'StrPos' to 0.             }π    REPEAT                      { Loop until every char checked.        }π     INC(StrPos);               { Point to next char.                   }π     IF UpCase(Str1[StrPos]) <> UpCase(Str2[StrPos]) THENπ      BEGINπ       Result := FALSE;         { If there not the same then return     }π                                { a FALSE result.                       }π       StrPos := Length(Str2);  { Now set loop exit condition.          }π      END;π    UNTIL StrPos = Length(Str2);π   END;ππ  Compare := Result;            { Return proper result.                 }πEND;{Compare}ππFUNCTION Arr2String( VAR Arr; Len :BYTE ) :STRING;π                         { Routine to convert 'Len' bytes of the array  }π                         { 'Arr' into a string.                         }πVARπ   Result :STRING;              { Holds function result.                }πBEGINπ  MOVE(Arr,Result[1],Len);      { Move bytes into our result string.    }π  Result[0] := CHR(Len);        { Set string length byte.               }ππ  Arr2String := Result;         { Return proper result.                 }πEND;{Arr2String}ππFUNCTION Fmt( Info :WORD ) :STRING;π                         { Routine to create a String with info int the }π                         { format '00'.                                 }πVARπ   Temp :STRING;                { Hold temporary string info.           }πBEGINπ  Str(Info,Temp);               { Convert info to a string.             }π  IF Length(Temp) = 1 THEN      { if its only a single digit then add   }π    Fmt := '0'+Temp             { leading zero.                         }π  ELSEπ    Fmt := Temp;πEND;{Fmt}ππFUNCTION TimeStr :STRING;πVARπ   Hour,Min,Sec,Sec100 :WORD;   { Holds temporary time info.            }π   Year,Mon,Day,DoWeek :WORD;   { Holds temporary date info.            }π   TempTime :STRING;            { Holds temporary TimeStr.              }πBEGINπ  GetDate(Year,Mon,Day,DoWeek);π  TempTime := Fmt(Mon)+'-'+Fmt(Day)+'-'+Fmt(Year-1900)+' at ';π  GetTime(Hour,Min,Sec,Sec100); { Get Current Time.                     }π  IF Hour >= 12 THENπ    TempTime := TempTime+Fmt(Hour-12)+':'+Fmt(Min)+'pm'π  ELSEπ    IF Hour = 0 THENπ      TempTime := TempTime+'12:'+Fmt(Min)+'am'π    ELSEπ      TempTime := TempTime+Fmt(Hour)+':'+Fmt(Min)+'pm';π  TimeStr := TempTime;πEND;ππFUNCTION GetOrigin( Chunks :WORD ) :STRING;π                         { Routine to get message origin line if any.   }πVARπ   Result :STRING;              { Holds function result.                }π   CurChnk:WORD;                { Holds current chunk being read.       }π   BufPos :WORD;                { Position within buffer.               }π   Temp   :STRING;π   NumRead:WORD;                { Holds number of bytes read from file. }π   Buffer :ARRAY[1..128] OF CHAR;{ Buffer for info read from file.      }π   TareLin:BOOLEAN;             { Holds whether or not we've past the   }π                                { tear line.                            }πBEGINπ  Result := '';                 { Clear result.                         }π  Temp := '';                   { Clear temporary storage space.        }π  TareLin := FALSE;             { Default to FALSE.                     }π  FOR CurChnk := 1 TO Chunks-1 DO { Loop through all the 128 byte chunks.}π   BEGINπ    BlockRead(MessDat,Buffer,128,NumRead); { Read message info.         }π    FOR BufPos := 1 TO 128 DOπ     BEGINπ      IF Buffer[BufPos] = #227 THENπ       BEGINπ        IF Temp = '---' THENπ         TareLin := TRUEπ        ELSEπ         IF TareLin AND (Temp <> PadStr(Right,'',Length(Temp),' ')) THENπ          Result := Temp;π        Temp := ''π       ENDπ      ELSEπ       Temp := Temp + Buffer[BufPos];π     END;π   END;ππ  IF (Result = '') OR (Pos('ILink:',Result) = 0) THENπ   Result := ' ■ Origin Line Unavailable ■ ';ππ  GetOrigin := Result;          { Return proper result.                 }πEND;ππPROCEDURE ReadMsgs;π                         { Routine to read Messages and save new members}π                         { to disk.                                     }πVARπ  MessBuf :MsgDHdr;             { Holds header info read from file.     }π  InfPos  :WORD;                { Loop variable for searching 'FileInf'.}π  CurMess :WORD;                { Loop variable for reading messages.   }π  NumRead :WORD;                { Holds number of bytes read from file. }π  Found   :BOOLEAN;             { Holds whether or not name was already }π                                { read.                                 }π  FoundPos:WORD;                { Holds position in array name was found.}π  Temp    :STRING;              { Holds temporary string info.          }π  Chunks  :WORD;                { Holds number of 128 byte chunks message}π                                { takes up in file.                     }π  ErrCode :WORD;                { Holds error codes returned from 'Val'.}π  Create  :BOOLEAN;πBEGINπ  Create  := NOT fExist(OutFile);π  IF NumFound = 0 THEN NumFound := 1;π  Assign(MessDat,WorkDir+'\MESSAGES.DAT');{ Assign handle to message file.}π  {$I-}                         { Turn I/O checking off.                }π  Reset(MessDat,1);             { Open file for reading.                }π  {$I+}                         { Turn I/O checking back on.            }π  FOR CurMess := 1 TO NumMess DO { Loop through all the messages.       }π   BEGINπ     Seek(MessDat,fOfs[CurMess]);{ Move to current message position.    }π     BlockRead(MessDat,MessBuf,SizeOf(MessBuf),NumRead); { Read Header. }π     FOR InfPos := 1 TO NumFound DOπ      BEGINπ       Found := Compare(FInf[InfPos].Name,Arr2String(MessBuf.MFrom,25));π       IF Found THENπ        InfPos := NumFound;π      END;π     IF NOT Found THENπ      BEGINπ       INC(NewMems);            { Increase number of new members.       }π       IF Create AND (NumFound = 1) THENπ        BEGINπ          NumFound := 0;π          Create := FALSE;π        END;π       INC(NumFound);           { Increase number found.                }ππ       FInf[NumFound].Name := Arr2String(MessBuf.MFrom,25);π       Temp := Arr2String(MessBuf.NChunks,6);π       RemoveSpaces(Temp);π       Val(Temp,Chunks,ErrCode);π       FInf[NumFound].Origin := GetOrigin(Chunks);π      END;π   END;π  Close(MessDat);               { Close message file.                   }πEND;{ReadMsgs}ππPROCEDURE SaveList;π                         { Routine to write our list to the list file.  }πVARπ   ListPos :WORD;               { Position withing list being written.  }πBEGINπ  Assign(OutHan,OutFile);       { Assign handle to file name.           }π  {$I-}                         { I/O off.                              }π  Rewrite(OutHan);              { Open file for writing.                }π  {$I+}                         { I/O on.                               }π  IF IOResult <> 0 THEN         { If there was an error.                }π   Writeln('-Error! Unable to Open ',OutFile,^G)π  ELSEπ   BEGINπ    Writeln(OutHan,'');         { Write a blank line to file.           }π    Writeln(OutHan,'/*'+PadStr(Right,'',75,'-')+'*/');ππ    Writeln(OutHan,'                         Conference [',ParamStr(2),π                   '] Members list.');π    Writeln(OutHan,PadStr(Right,'',24,' ')+'Last Change '+TimeStr);π    Writeln(OutHan,'/*'+PadStr(Right,'',75,'-')+'*/');π    FOR ListPos := 1 TO NumFound DOπ     BEGINπ      Writeln(OutHan,'');       { Writeln a blank line.                 }π      Writeln(OutHan,'User : '+FInf[ListPos].Name); { Writeln user name.}π      Writeln(OutHan,FInf[ListPos].Origin); { Write users origin line.  }π     END;π    Close(OutHan);                { Close file.                           }π   END;πEND;{SaveList}ππPROCEDURE ReadList;π                         { Routine to read in the conf members list.    }πVARπ   InFile :TEXT;                { Text handle for conference list.      }π   Temp   :STRING;              { Holds string read from file.          }πBEGINπ  NumFound := 0;π  Assign(InFile,OutFile);       { Assign handle to file name.           }π  {$I-}                         { I/O checking off.                     }π  Reset(Infile);                { Open file for reading.                }π  {$I+}                         { I/O checking on.                      }π  WHILE (NOT EOF(InFile)) AND (NumFound <500) DOπ   BEGINπ    ReadLn(InFile,Temp);        { Read a line from the file.            }π    IF Copy(Temp,1,7) = 'User : ' THEN { If its the user name then.     }π     BEGIN                      { Save Name to array and read origin.   }π      INC(NumFound);π      FInf[NumFound].Name := Copy(Temp,8,Length(Temp));π      ReadLn(InFile,FInf[NumFound].Origin);π     END;π   END;π  IF NumFound = 0 THENπ   NumFound := 1;π  Close(InFile);                { Close file.                           }πEND;{ReadList}ππPROCEDURE SortList;π                         { Routine to sort the list of conference       }π                         { members using a simple bubble sort.          }πVARπ   Temp  :MessInfType;          { Temporary record for swapping.        }π   Index1,Index2:WORD;          { Sort loop variables.                  }πBEGINπ  FOR Index1 := NumFound DOWNTO 1 DOπ   FOR Index2 := 2 TO Index1 DOπ    IF FInf[Index2-1].Name > FInf[Index2].Name THENπ     BEGINπ      Temp := FInf[Index2];π      FInf[Index2] := FInf[Index2-1];π      FInf[Index2-1] := Temp;π     END;πEND;{SortList}ππBEGINπ  Writeln(ProgTitle);           { Display program title.                }ππ  IF (ParamCount <> 2) OR NotNumber(ParamStr(2)) THENπ                                { If wrong command argument show proper }π    Syntax_Error                { syntax to use.                        }π  ELSEπ   BEGINπ    InitVars;                   { Initialize variables.                 }π    IF fExist(QWKName) THEN     { If it exists begin processing.        }π     BEGINπ      Writeln('-Opening Packet');π      OpenPacket(QWKName);      { Open mail packet.                     }π      IF fExist(WorkDir+'\'+PadStr(Left,ParamStr(2),3,'0')+'.NDX') THENπ       BEGIN                    { IF there are any Messages in conf then}π                                { Attempt to read NDX files.            }π        Writeln('-Reading NDX file');ππ        IF ReadNDX THEN         { IF there is no error, read messages.  }π         BEGINππ          IF fExist(OutFile) THEN{ IF Conf list already exist then read.}π           BEGINπ            Writeln('-Reading ',OutFile);π            ReadList;ππ           END;ππ          Writeln('-Reading Messages in conference [',ParamStr(2),']');π          ReadMsgs;ππ          IF NewMems > 0 THENπ           BEGINππ            IF fExist(OutFile) THENπ             BEGINπ              Writeln('-Renaming ',OutFile,' to ',Copy(OutFile,1,8)+'.BAK');ππ              IF fExist(Copy(OutFile,1,8)+'.BAK') THENπ               BEGINπ                Assign(OutHan,Copy(OutFile,1,8)+'.BAK');π                Erase(OutHan);π               END;ππ              Assign(OutHan,OutFile);π              Rename(OutHan,Copy(OutFile,1,8)+'.BAK');π             ENDπ            ELSEπ             BEGINπ              Writeln('-Creating ',OutFile);π              Assign(OutHan,OutFile);π              {$I-}π              Rewrite(OutHan);π              {$I+}π              Close(OutHan);π             END;π            Writeln('-Sorting member list');π            SortList;π            Writeln('-Saving ',NewMems,π                    ' new members for a total of ',NumFound,' members');π            SaveList;π           ENDπ          ELSEπ           Writeln('-No new members found');π         ENDπ        ELSEπ         Writeln('-Error reading NDX file',^G);π       ENDπ      ELSE                      { Other wise let user know its not there.}π       Writeln('-NDX file for conference [',ParamStr(2),π               '] does not exist. No new messages?'^G);ππ      Writeln('-Deleteing Work Directory');π      DelWorkDir;               { Delete Work Directory.                }π      {$I-}                     { Turn I/O checking off.                }π      RMDir(WorkDir);           { Remove work Directory.                }π      {$I+}                     { Turn I/O checking on.                 }π      IF IOResult <> 0 THEN     { If and error occurs then              }π      Writeln('Error Removing work directory.',^G);ππ     ENDπ    ELSE                        { .... Otherwise ......                 }π     BEGIN                      { Show error message and beep.          }π      Writeln(^G,'Cannot find ',QWKName);π      Writeln('Tracking aborted!!');π     END;π   END;πEND.{NMembers}π{***********************************************************************}π